[SPARK-11270] [STREAMING] Add improved equality testing for TopicAndPartition from the Kafka Streaming API#9236
Closed
ontarionick wants to merge 2 commits intoapache:masterfrom
Closed
Conversation
…, not the instance
Contributor
|
LGTM, the test is in |
Contributor
Author
|
Tests added! |
Contributor
|
ok to test |
Contributor
|
LGTM. Will merge when tests pass. |
|
Test build #44391 has finished for PR 9236 at commit
|
Contributor
|
Could you update the code to fix the python style issues? On Mon, Oct 26, 2015 at 7:32 PM, UCB AMPLab notifications@github.com
|
669a7ba to
8a3e5a3
Compare
Contributor
Author
|
@tdas fixed! |
|
Test build #44393 has finished for PR 9236 at commit
|
asfgit
pushed a commit
that referenced
this pull request
Oct 27, 2015
…rtition from the Kafka Streaming API
jerryshao tdas
I know this is kind of minor, and I know you all are busy, but this brings this class in line with the `OffsetRange` class, and makes tests a little more concise.
Instead of doing something like:
```
assert topic_and_partition_instance._topic == "foo"
assert topic_and_partition_instance._partition == 0
```
You can do something like:
```
assert topic_and_partition_instance == TopicAndPartition("foo", 0)
```
Before:
```
>>> from pyspark.streaming.kafka import TopicAndPartition
>>> TopicAndPartition("foo", 0) == TopicAndPartition("foo", 0)
False
```
After:
```
>>> from pyspark.streaming.kafka import TopicAndPartition
>>> TopicAndPartition("foo", 0) == TopicAndPartition("foo", 0)
True
```
I couldn't find any tests - am I missing something?
Author: Nick Evans <me@nicolasevans.org>
Closes #9236 from manygrams/topic_and_partition_equality.
(cherry picked from commit 8f888ee)
Signed-off-by: Tathagata Das <tathagata.das1565@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@jerryshao @tdas
I know this is kind of minor, and I know you all are busy, but this brings this class in line with the
OffsetRangeclass, and makes tests a little more concise.Instead of doing something like:
You can do something like:
Before:
After:
I couldn't find any tests - am I missing something?